package 天梯赛.tts44.moni.a6;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int n=new Scanner(System.in).nextInt();
        int temp=1;
        while (true){
            int sum1 = calculate(temp, n + 1);
            int sum2 = calculate(temp+n+1,n);
            if (sum1==sum2){
                break;
            }
            temp++;
        }
        StringBuffer str=new StringBuffer();
        for (int i = 0; i <=n ; i++) {
            str.append(getX(temp));
            temp++;
        }
        str.deleteCharAt(str.length()-2);
        str.deleteCharAt(str.length()-1);
        str.append("=");

        System.out.println(str.toString());
        str=new StringBuffer();

        for (int i = 0; i <n ; i++) {
            str.append(getX(temp));
            temp++;
        }
        str.deleteCharAt(str.length()-1);
        str.deleteCharAt(str.length()-1);
        str.deleteCharAt(str.length()-1);
        System.out.println(str.toString());
    }


    public static String  getX(int x){
        return  x+"^2 + ";
    }

    public static int  calculate(int x,int n){
        int sum=0;
        int i=x;
        while (i<x+n){
            sum+=i*i;
            i++;
        }
        return sum;
    }
}
